package net.sansi.v3correctserver.service.correctresult.convert;

import net.sansi.v3correctserver.entity.screen.Panel;
import net.sansi.v3correctserver.service.space.ProjectSpace;
import net.sansi.v3correctserver.util.Matrix;

import java.nio.file.Path;
import java.util.List;

/**
 * Created by Fang
 * create time : 2025/2/26
 * IDE : IntelliJ IDEA
 * <p>
 * CL 文件
 * 1. 面板系数文件
 */

public class FactorToCLConvert extends FactorConvert<Panel> {

    private final ProjectSpace projectSpace;

    /**
     * 构造函数
     *
     * @param section      分区
     * @param results      结果
     * @param is3Factor    是否是3系数
     * @param projectSpace 项目空间
     */
    public FactorToCLConvert(
            Panel section,
            List<Matrix<double[]>> results,
            boolean is3Factor,
            ProjectSpace projectSpace
    ) {
        super(section, results, is3Factor);
        this.projectSpace = projectSpace;
    }

    @Override
    Path genFilePath(Panel section) {
        return projectSpace.factorCL(section.getId());
    }

}
